<?php
/*
倍洽机器人工具 
*/
namespace Rice\tools;
class bearychat {

	public function Incoming($webhook,$dda){
      //下边数据正确，以json格式，但要转换为字符串！   
	    $data['text']=$dda['title'];//大标题
	    $data['markdown']=true;
	    $data['attachments'][0]['title']=$dda['title_title'];//小标题
	    $data['attachments'][0]['url']=$dda['url'];//转跳url
	    
	    for ($i=0; $i < count($dda['text']); $i++) { 
	    	$data['attachments'][$i]['text']=$dda['text'][$i]['text'];//文章详情
	    }
	     
	    $data['attachments'][0]['color']='#F759FF';//边线颜色
	    $data['attachments'][0]['images'][0]['url']=$dda['img'];//图片
	    $dataqq =  json($data,'json');
	    $data=post($webhook,$dataqq);
	    return $data;
    }


}
